package com.example.content.fragment.im

import android.content.ClipboardManager
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.ViewModelProvider
import com.example.content.R
import com.example.content.viewmodule.im.MessageViewModel
import com.example.core.livedata.LiveDataBus
import com.hyphenate.easeui.constants.EaseConstant
import com.hyphenate.easeui.model.EaseEvent
import com.hyphenate.easeui.ui.EaseChatFragment

/**
 * Created by zhudongao
 * Desc
 * Date 2020/11/14
 */
class ChatFragment : BaseChatFragment() {
    private lateinit var viewModel:MessageViewModel
    private lateinit var clipboard:ClipboardManager

    override fun getChatLayout(): Int {
        return R.layout.fragment_chat
    }

    override fun initChildView() {
        super.initChildView()
        clipboard = activity?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        viewModel = ViewModelProvider(this).get(MessageViewModel::class.java)
    }

    override fun initChildData() {
        super.initChildData()
        LiveDataBus.get().with(EaseConstant.MESSAGE_CHANGE_CHANGE)
            .postValue(EaseEvent(EaseConstant.MESSAGE_CHANGE_CHANGE, EaseEvent.TYPE.MESSAGE))
    }

}